﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Ultima.Xna.Graphics
{
    public sealed class OrthographicCamera : Camera
    {
        PresentationParameters presentationParams;

        public OrthographicCamera(Game game)
            : base(game)
        {
            View = Matrix.Identity;
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            PresentationParameters pp = Game.GraphicsDevice.PresentationParameters;

            if (presentationParams != pp)
            {
                presentationParams = pp;

                Projection = Matrix.CreateOrthographicOffCenter(0, pp.BackBufferWidth, pp.BackBufferHeight, 0, -256, 256);
            }
        }
    }
}
